import request from '@/utils/request.js'
import {ref} from 'vue'

/**
 * 获取商品列表（干洗店）
 * @param {Object} params  { shopId, status, page, limit }
 * @returns {Promise} 商品数组
 */
export function fetchOrderList(data) {
  return request({
    method: 'POST',
    url: '/orderList',            // 相对路径（baseURL 已配置）
    data                            // GET 用 params
  })
}
export function addNote(data){
	return request({
		method:'POST',
		url:'/orderEdit',
		data
	})
}
// 获取所有订单的订单编码
export function fetchAllCode(data){
	return request({
		method:'POST',
		url:'/getOrderNumbersByShop',
		data
	})
}

export const orderMock = {
	'已下单': [{
			id: 1,
			code: '20250625001',
			money: 39.9,
			time: '2025-06-25 10:30',
			user: '张三',
			note: '红色短款羽舞蹈室看看斯奥合并成本绒服',
			number:15233833486,
			images:[
				'/static/wode.png',
				'/static/one.png',
				'/static/finish.png',
			],
			_action: '已到店',
			_anim: false
		},
		{
			id: 2,
			code: '20250625002',
			money: 59,
			time: '2025-06-25 11:15',
			user: '李四',
			note: '',
			number:15233833486,
			images:[
				'/static/wode.png',
				'/static/one.png',
				'/static/finish.png',
			],
			_action: '已到店',
			_anim: false
		},
		{
				id: 1,
				code: '20250625001',
				money: 39.9,
				time: '2025-06-25 10:30',
				user: '张三',
				note: '红色短款羽舞蹈室看看斯奥合并成本绒服',
				number:15233833486,
				_action: '已到店',
				_anim: false
			},
			{
					id: 1,
					code: '20250625001',
					money: 39.9,
					time: '2025-06-25 10:30',
					user: '张三',
					note: '红色短款羽舞蹈室看看斯奥合并成本绒服',
					number:15233833486,
					_action: '已到店',
					_anim: false
				},
				{
						id: 1,
						code: '20250625001',
						money: 39.9,
						time: '2025-06-25 10:30',
						user: '张三',
						note: '红色短款羽舞蹈室看看斯奥合并成本绒服',
						number:15233833486,
						_action: '已到店',
						_anim: false
					},
					{
							id: 1,
							code: '20250625001',
							money: 39.9,
							time: '2025-06-25 10:30',
							user: '张三',
							note: '红色短款羽舞蹈室看看斯奥合并成本绒服',
							number:15233833486,
							_action: '已到店',
							_anim: false
						},
						{
								id: 1,
								code: '20250625001',
								money: 39.9,
								time: '2025-06-25 10:30',
								user: '张三',
								note: '红色短款羽舞蹈室看看斯奥合并成本绒服',
								number:15233833486,
								_action: '已到店',
								_anim: false
							},
	],
	'已到店': [{
		id: 3,
		code: '20250624001',
		money: 89,
		time: '2025-06-24 09:20',
		user: '王五',
		note: '羽绒服*2',
		number:15233833486,
		_action: '已清洗',
		_anim: false
	}],
	'已清洗': [{
		id: 4,
		code: '20250623001',
		money: 129,
		time: '2025-06-23 14:10',
		user: '赵六',
		note: '',
		number:15233833486,
		_action: '已烘干',
		_anim: false
	}],
	'已烘干': [],
	'已熨烫': [],
	'已打包': [
		{
			id: 8,
			code: '20250625002',
			money: 59,
			time: '2025-06-25 11:15',
			user: '小美',
			note: '',
			number:15233833486,
			images:[
				'/static/wode.png',
				'/static/one.png',
				'/static/finish.png',
			],
			_action: '已完成',
			_anim: false
		},
	],
	'已完成':[]
}